﻿using Newtonsoft.Json;

namespace Entity
{
    /// <summary>
    /// 拼团记录表
    /// </summary>
    public class TeamBuyLog : BaseEntity
    {
        /// <summary>
        /// 所属商户
        /// </summary>
        public int StoreId { get; set; }

        /// <summary>
        /// 所属代理
        /// </summary>
        public int ProxyId { get; set; }

        /// <summary>
        /// 对应的拼团
        /// </summary>
        public int TeamBuyId { get; set; }

        /// <summary>
        /// 参与拼团的用户
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 用户昵称
        /// </summary>
        public string? NickName { get; set; }

        /// <summary>
        /// 用户头像
        /// </summary>
        public string? Avatar { get; set; }

        /// <summary>
        /// 是否是机器人
        /// </summary>
        public bool IsRobot { get; set; }

        /// <summary>
        /// 入团时间
        /// </summary>
        public DateTime JoinTime { get; set; }

        /// <summary>
        /// 是否是中奖用户
        /// </summary>
        public bool IsWinner { get; set; } = false;

        /// <summary>
        /// 拼团信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(TeamBuyId))]
        public TeamBuy? TeamBuy { get; set; }

        /// <summary>
        /// 未结束参团的累计红包金额
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public decimal HistoryMoney { get; set; }

        /// <summary>
        /// 未结束参团的累计参与次数
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public decimal HistoryCount { get; set; }

    }
}
